﻿@model Wheeler.Web.ViewModels.ChangePasswordModel
@using Wheeler.Web.ViewModels;
@using Wheeler.Common.Extensions;

@{
    Layout = "~/Views/Shared/_LayoutPrivate.cshtml";
    String pageTitle = "Change Password";
    ViewBag.Title = Html.GetPageTitle(pageTitle);
    bool _HasSaved = WebUtil.GetQueryStringValue("IsSaved").ToBoolean();
    ViewData[AppConstants.ViewDataKeys.SELECTED_MENU] = OperatorMenu.ChangePassword;
    
}

<div class="jb-page-heading">
    <h1>@pageTitle</h1>
    <div>Enter necessary information and then click the Save button.</div>
</div>

<div class="jb-page-content">
    @using (Html.BeginForm()) {
        @Html.ValidationSummary(true)

        if (_HasSaved)
        {
            @:@Html.SuccessMessageBox("Congratulations! Your password changed successfully.", "Success!")
        }

        <div class="editor-label">
			@Html.LabelFor(model => model.OldPassword)
		</div>
		<div class="editor-field">
			@Html.PasswordFor(model => model.OldPassword)
			@Html.ValidationMessageFor(model => model.OldPassword)
		</div>
        <div class="editor-label">
			@Html.LabelFor(model => model.NewPassword)
		</div>
		<div class="editor-field">
			@Html.PasswordFor(model => model.NewPassword)
			@Html.ValidationMessageFor(model => model.NewPassword)
		</div>
        <div class="editor-label">
			@Html.LabelFor(model => model.ConfirmPassword)
		</div>
		<div class="editor-field">
			@Html.PasswordFor(model => model.ConfirmPassword)
			@Html.ValidationMessageFor(model => model.ConfirmPassword)
		</div>
        
        <div class="jb-button-container">
			<button class="btn btn-primary" type="submit" data-loading-text="Saving..."><i class="icon-hdd icon-white"></i> Save</button> 
		</div>
    }
</div>

@section JavaScriptPlaceHolder
{
    @Html.JavaScript("jquery.validate.min.js", Url)
    @Html.JavaScript("jquery.validate.unobtrusive.min.js", Url)
}